package uk.ac.cam.djjb2.mygame;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class BasicTile implements Tile {
	private final int id;
	private int imageIndex;
	private Set<String> attributes;
	
	public BasicTile(int id, int imageIndex, String... attributes) {
		this.id = id;
		this.imageIndex = imageIndex;
		this.attributes = new HashSet<String>(Arrays.asList(attributes));
	}
	
	@Override
	public int getId() {
		return id;
	}

	@Override
	public int getImageIndex(TileMap map, Vector2i pos) {
		return imageIndex;
	}

	@Override
	public boolean getAttribute(TileMap map, Vector2i pos, String name) {
		return this.attributes.contains(name);
	}

}
